load("@build_bazel_rules_android//android:rules.bzl", "android_library")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

java_library(
    name = "hmac_key_manager",
    srcs = ["HmacKeyManager.java"],
    deps = [
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:key_template",
        "//src/main/java/com/google/crypto/tink:key_type_manager",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink/subtle:prf_hmac_jce",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/subtle:validators",
        "@com_google_protobuf//:protobuf_javalite",
    ],
)

android_library(
    name = "hmac_key_manager-android",
    srcs = ["HmacKeyManager.java"],
    deps = [
        "//proto:common_java_proto_lite",
        "//proto:hmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:key_template-android",
        "//src/main/java/com/google/crypto/tink:key_type_manager-android",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
        "//src/main/java/com/google/crypto/tink/subtle:prf_hmac_jce",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/subtle:validators",
        "@com_google_protobuf//:protobuf_javalite",
    ],
)

java_library(
    name = "mac_factory",
    srcs = ["MacFactory.java"],
    deps = [
        ":mac_wrapper",
        "//src/main/java/com/google/crypto/tink:key_manager",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:primitive_set",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
    ],
)

android_library(
    name = "mac_factory-android",
    srcs = ["MacFactory.java"],
    deps = [
        ":mac_wrapper-android",
        "//src/main/java/com/google/crypto/tink:key_manager-android",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:primitive_set-android",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
    ],
)

java_library(
    name = "mac_key_templates",
    srcs = ["MacKeyTemplates.java"],
    deps = [
        ":aes_cmac_key_manager",
        ":hmac_key_manager",
        "//proto:aes_cmac_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
    ],
)

android_library(
    name = "mac_key_templates-android",
    srcs = ["MacKeyTemplates.java"],
    deps = [
        ":aes_cmac_key_manager-android",
        ":hmac_key_manager-android",
        "//proto:aes_cmac_java_proto_lite",
        "//proto:common_java_proto_lite",
        "//proto:hmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
    ],
)

java_library(
    name = "mac_wrapper",
    srcs = ["MacWrapper.java"],
    deps = [
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:crypto_format",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:primitive_set",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
    ],
)

android_library(
    name = "mac_wrapper-android",
    srcs = ["MacWrapper.java"],
    deps = [
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:crypto_format-android",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:primitive_set-android",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper-android",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
    ],
)

java_library(
    name = "mac_config",
    srcs = ["MacConfig.java"],
    deps = [
        ":aes_cmac_key_manager",
        ":hmac_key_manager",
        ":mac_wrapper",
        "//proto:config_java_proto",
    ],
)

android_library(
    name = "mac_config-android",
    srcs = ["MacConfig.java"],
    deps = [
        ":aes_cmac_key_manager-android",
        ":hmac_key_manager-android",
        ":mac_wrapper-android",
        "//proto:config_java_proto_lite",
    ],
)

java_library(
    name = "aes_cmac_key_manager",
    srcs = ["AesCmacKeyManager.java"],
    deps = [
        "//proto:aes_cmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:key_template",
        "//src/main/java/com/google/crypto/tink:key_type_manager",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink/subtle:prf_aes_cmac",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/subtle:validators",
        "@com_google_protobuf//:protobuf_javalite",
    ],
)

android_library(
    name = "aes_cmac_key_manager-android",
    srcs = ["AesCmacKeyManager.java"],
    deps = [
        "//proto:aes_cmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:key_template-android",
        "//src/main/java/com/google/crypto/tink:key_type_manager-android",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
        "//src/main/java/com/google/crypto/tink/subtle:prf_aes_cmac",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/subtle:validators",
        "@com_google_protobuf//:protobuf_javalite",
    ],
)
